a3$n3<-a3$Freq #exact
afinal<-cbind(a1,a2,a3)
afinal<-afinal[,c("Var1","n1","n2","n3")]
afinal$total<-round(afinal$n1+afinal$n2+afinal$n3,2)
afinal$matched<-round((afinal$n3+afinal$n2)/(afinal$total)*100,2)
afinal$unmatched<-round((afinal$n1/afinal$total)*100,2)
afinal$fuzzymatched<-round((afinal$n2/afinal$total)*100,2)
afinal$exactmatched<-round((afinal$n3/afinal$total)*100,2)
afinal$sample<-"Excluded"
afinal$sample[afinal$total>=2000 & afinal$exactmatched>=59 & afinal$total>=80]<-"Main Sample"
afinal <- afinal %>%                                        # Create ID by group
group_by(sample) %>%
dplyr::mutate(ID = row_number())
afinal<-afinal[,c("ID","Var1","total","unmatched","matched","exactmatched","fuzzymatched","sample")]
afinal$Var1<-as.character(afinal$Var1)
statefinal<-afinal$Var1[afinal$sample=="Main Sample"]
afinal$Var1<-str_to_title(afinal$Var1, locale = "en")
afinal <- afinal[order(afinal$ID), ]
afinal <- afinal[order(afinal$sample, decreasing=TRUE),]
colnames(afinal)<-c("Sno.","State","N Villages Connected","Umatched","Matched","Exact Matched","Fuzzy Matched","Sample")
table_results <- stargazer(afinal, summary = FALSE, rownames = FALSE, type="latex")
capture.output(table_results, file="../2_Tables/Appendix_Table_B1.pdf")
rm(list=ls())
library(dplyr)
library(stringr)
library(stargazer)
load("../1_Data/slr_cleaned_2022.RData")
slr_census_final<-slr_cleaned
#STEP 1 - get an idea of matching levels
#######################################################################
a<-as.data.frame(table(slr_census_final$state,slr_census_final$slr_census_mergestatus))
a1<-subset(a, Var2=="unmatched")
a2<-subset(a, Var2=="fuzzy matched")
a3<-subset(a, Var2=="exact matched")
a1$n1<-a1$Freq #unmatched
a2$n2<-a2$Freq #fuzzy
a3$n3<-a3$Freq #exact
afinal<-cbind(a1,a2,a3)
afinal<-afinal[,c("Var1","n1","n2","n3")]
afinal$total<-round(afinal$n1+afinal$n2+afinal$n3,2)
afinal$matched<-round((afinal$n3+afinal$n2)/(afinal$total)*100,2)
afinal$unmatched<-round((afinal$n1/afinal$total)*100,2)
afinal$fuzzymatched<-round((afinal$n2/afinal$total)*100,2)
afinal$exactmatched<-round((afinal$n3/afinal$total)*100,2)
afinal$sample<-"Excluded"
afinal$sample[afinal$total>=2000 & afinal$exactmatched>=59 & afinal$total>=80]<-"Main Sample"
afinal <- afinal %>%                                        # Create ID by group
group_by(sample) %>%
dplyr::mutate(ID = row_number())
afinal<-afinal[,c("ID","Var1","total","unmatched","matched","exactmatched","fuzzymatched","sample")]
afinal$Var1<-as.character(afinal$Var1)
statefinal<-afinal$Var1[afinal$sample=="Main Sample"]
afinal$Var1<-str_to_title(afinal$Var1, locale = "en")
afinal <- afinal[order(afinal$ID), ]
afinal <- afinal[order(afinal$sample, decreasing=TRUE),]
colnames(afinal)<-c("Sno.","State","N Villages Connected","Umatched","Matched","Exact Matched","Fuzzy Matched","Sample")
table_results <- stargazer(afinal, summary = FALSE, rownames = FALSE, type="latex", results=asis)
table_results <- stargazer(afinal, summary = FALSE, rownames = FALSE, type="latex", results='asis')
capture.output(table_results, file="../2_Tables/Appendix_Table_B1.pdf")
---
output: pdf_document
---
output: pdf_document
library(knitr)
---
output: pdf_document
knitr::opts_chunk$set(echo = TRUE)
stargazer(afinal, summary = FALSE, rownames = FALSE, type="latex", header=FALSE)
knitr::opts_chunk$set(echo = TRUE)
stargazer(afinal, summary = FALSE, rownames = FALSE, type="latex", header=FALSE)
stargazer::stargazer(afinal, summary = FALSE, rownames = FALSE, type="latex", header=FALSE)
knitr::opts_chunk$set(echo = TRUE)
rm(list=ls())
library(dplyr)
library(stringr)
library(stargazer)
library(knitr)
load("../1_Data/slr_cleaned_2022.RData")
slr_census_final<-slr_cleaned
#STEP 1 - get an idea of matching levels
#######################################################################
a<-as.data.frame(table(slr_census_final$state,slr_census_final$slr_census_mergestatus))
a1<-subset(a, Var2=="unmatched")
a2<-subset(a, Var2=="fuzzy matched")
a3<-subset(a, Var2=="exact matched")
a1$n1<-a1$Freq #unmatched
a2$n2<-a2$Freq #fuzzy
a3$n3<-a3$Freq #exact
afinal<-cbind(a1,a2,a3)
afinal<-afinal[,c("Var1","n1","n2","n3")]
afinal$total<-round(afinal$n1+afinal$n2+afinal$n3,2)
afinal$matched<-round((afinal$n3+afinal$n2)/(afinal$total)*100,2)
afinal$unmatched<-round((afinal$n1/afinal$total)*100,2)
afinal$fuzzymatched<-round((afinal$n2/afinal$total)*100,2)
afinal$exactmatched<-round((afinal$n3/afinal$total)*100,2)
afinal$sample<-"Excluded"
afinal$sample[afinal$total>=2000 & afinal$exactmatched>=59 & afinal$total>=80]<-"Main Sample"
afinal <- afinal %>%                                        # Create ID by group
group_by(sample) %>%
dplyr::mutate(ID = row_number())
afinal<-afinal[,c("ID","Var1","total","unmatched","matched","exactmatched","fuzzymatched","sample")]
afinal$Var1<-as.character(afinal$Var1)
statefinal<-afinal$Var1[afinal$sample=="Main Sample"]
afinal$Var1<-str_to_title(afinal$Var1, locale = "en")
afinal <- afinal[order(afinal$ID), ]
afinal <- afinal[order(afinal$sample, decreasing=TRUE),]
colnames(afinal)<-c("Sno.","State","N Villages Connected","Umatched","Matched","Exact Matched","Fuzzy Matched","Sample")
stargazer::stargazer(afinal, summary = FALSE, rownames = FALSE, type="latex", header=FALSE)
knitr::opts_chunk$set(echo = TRUE)
rm(list=ls())
library(dplyr)
library(stringr)
library(stargazer)
library(knitr)
load("../1_Data/slr_cleaned_2022.RData")
slr_census_final<-slr_cleaned
#STEP 1 - get an idea of matching levels
#######################################################################
a<-as.data.frame(table(slr_census_final$state,slr_census_final$slr_census_mergestatus))
a1<-subset(a, Var2=="unmatched")
a2<-subset(a, Var2=="fuzzy matched")
a3<-subset(a, Var2=="exact matched")
a1$n1<-a1$Freq #unmatched
a2$n2<-a2$Freq #fuzzy
a3$n3<-a3$Freq #exact
afinal<-cbind(a1,a2,a3)
afinal<-afinal[,c("Var1","n1","n2","n3")]
afinal$total<-round(afinal$n1+afinal$n2+afinal$n3,2)
afinal$matched<-round((afinal$n3+afinal$n2)/(afinal$total)*100,2)
afinal$unmatched<-round((afinal$n1/afinal$total)*100,2)
afinal$fuzzymatched<-round((afinal$n2/afinal$total)*100,2)
afinal$exactmatched<-round((afinal$n3/afinal$total)*100,2)
afinal$sample<-"Excluded"
afinal$sample[afinal$total>=2000 & afinal$exactmatched>=59 & afinal$total>=80]<-"Main Sample"
afinal <- afinal %>%                                        # Create ID by group
group_by(sample) %>%
dplyr::mutate(ID = row_number())
afinal<-afinal[,c("ID","Var1","total","unmatched","matched","exactmatched","fuzzymatched","sample")]
afinal$Var1<-as.character(afinal$Var1)
statefinal<-afinal$Var1[afinal$sample=="Main Sample"]
afinal$Var1<-str_to_title(afinal$Var1, locale = "en")
afinal <- afinal[order(afinal$ID), ]
afinal <- afinal[order(afinal$sample, decreasing=TRUE),]
colnames(afinal)<-c("Sno.","State","N Villages Connected","Umatched","Matched","Exact","Fuzzy","Sample")
stargazer::stargazer(afinal, summary = FALSE, rownames = FALSE, type="latex", header=FALSE)
knitr::opts_chunk$set(echo = TRUE)
rm(list=ls())
library(dplyr)
library(stringr)
library(stargazer)
library(knitr)
load("../1_Data/slr_cleaned_2022.RData")
slr_census_final<-slr_cleaned
#STEP 1 - get an idea of matching levels
#######################################################################
a<-as.data.frame(table(slr_census_final$state,slr_census_final$slr_census_mergestatus))
a1<-subset(a, Var2=="unmatched")
a2<-subset(a, Var2=="fuzzy matched")
a3<-subset(a, Var2=="exact matched")
a1$n1<-a1$Freq #unmatched
a2$n2<-a2$Freq #fuzzy
a3$n3<-a3$Freq #exact
afinal<-cbind(a1,a2,a3)
afinal<-afinal[,c("Var1","n1","n2","n3")]
afinal$total<-round(afinal$n1+afinal$n2+afinal$n3,2)
afinal$matched<-round((afinal$n3+afinal$n2)/(afinal$total)*100,2)
afinal$unmatched<-round((afinal$n1/afinal$total)*100,2)
afinal$fuzzymatched<-round((afinal$n2/afinal$total)*100,2)
afinal$exactmatched<-round((afinal$n3/afinal$total)*100,2)
afinal$sample<-"Excluded"
afinal$sample[afinal$total>=2000 & afinal$exactmatched>=59 & afinal$total>=80]<-"Main Sample"
afinal <- afinal %>%                                        # Create ID by group
group_by(sample) %>%
dplyr::mutate(ID = row_number())
afinal<-afinal[,c("ID","Var1","total","unmatched","matched","exactmatched","fuzzymatched","sample")]
afinal$Var1<-as.character(afinal$Var1)
statefinal<-afinal$Var1[afinal$sample=="Main Sample"]
afinal$Var1<-str_to_title(afinal$Var1, locale = "en")
afinal <- afinal[order(afinal$ID), ]
afinal <- afinal[order(afinal$sample, decreasing=TRUE),]
colnames(afinal)<-c("Sno.","State","N Villages Connected","Umatched","Matched","Exact","Fuzzy","Sample")
stargazer::stargazer(afinal, summary = FALSE, rownames = FALSE, type="latex", header=FALSE)
rmarkdown::render('02_MatchingTable.Rmd', output_file = '../2_Tables/Appendix_Table_B1.pdf')
rm(list=ls())
library(dplyr)
library(stringr)
library(stargazer)
library(knitr)
library(rmarkdown)
rmarkdown::render('02_MatchingTable.rmd', output_file = '../2_Tables/Appendix_Table_B1.pdf')
rm(list=ls())
library(rmarkdown)
rmarkdown::render('02_MatchingTable.rmd', output_file = '../2_Tables/Appendix_Table_B1.pdf')
load("../1_Data/slrnew2.RData")
rm(list=ls())
library(rmarkdown)
rmarkdown::render('02_MatchingTable.rmd', output_file = '../2_Tables/Appendix_Table_B1.pdf')
load("../1_Data/slrnew2.RData")
nrow(slrnew2)
# [1] 186988
prop.table(table(slrnew2$proposaltype))
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
prop.table(table(slrnew2$imsupgradeconnect))
# new upgrade
# bridge   5859    2415
# road   126567   52147
slrnew2<-subset(slrnew2, slrnew2$roadcode %in% slr_census_final$roadcode)
# nrow(slrnew2)
# [1] 172204
172204/186988
table(slrnew2$proposaltype)
prop.table(table(slrnew2$proposaltype))
# bridge   road
# 3389 168815
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
# new upgrade
# bridge   2676     713
# road   120476   48339
slrnew2<-subset(slrnew2, slrnew2$state %in% statefinal)
nrow(slrnew2)
# [1] 143725
prop.table(table(slrnew2$proposaltype))
# bridge      road
# 0.0184519 0.9815481
x<-as.data.frame(table(slrnew2$startyear))
library(ggplot2)
# Basic barplot
ggplot(data=x, aes(x=Var1, y=Freq)) +
geom_bar(stat="identity")+
geom_text(aes(label=Freq),vjust=-1.6)+
labs(x="Year", y = "Number of PMGSY projects")+
theme_classic()+  theme(strip.background = element_rect(size=1.5, linetype="blank"))+
theme(strip.text.y = element_text(size=8, angle = 0, hjust = 1))
ggsave("../3_Figs/FigB1.pdf", width=11.5, height=9)
rm(list=ls())
library(rmarkdown)
rmarkdown::render('02_MatchingTable.rmd', output_file = '../2_Tables/Appendix_Table_B1.pdf')
rm(list=ls())
library(rmarkdown)
rmarkdown::render('02_MatchingTable.rmd', output_file = '../2_Tables/Appendix_Table_B1.pdf')
load("../1_Data/slrnew2.RData")
nrow(slrnew2)
# [1] 186988
prop.table(table(slrnew2$proposaltype))
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
prop.table(table(slrnew2$imsupgradeconnect))
# new upgrade
# bridge   5859    2415
# road   126567   52147
slrnew2<-subset(slrnew2, slrnew2$roadcode %in% slr_census_final$roadcode)
load("../1_Data/slr_cleaned_2022.RData")
slr_census_final<-slr_cleaned
load("../1_Data/slrnew2.RData")
nrow(slrnew2)
# [1] 186988
prop.table(table(slrnew2$proposaltype))
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
prop.table(table(slrnew2$imsupgradeconnect))
# new upgrade
# bridge   5859    2415
# road   126567   52147
slrnew2<-subset(slrnew2, slrnew2$roadcode %in% slr_census_final$roadcode)
# nrow(slrnew2)
# [1] 172204
172204/186988
table(slrnew2$proposaltype)
prop.table(table(slrnew2$proposaltype))
# bridge   road
# 3389 168815
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
# new upgrade
# bridge   2676     713
# road   120476   48339
slrnew2<-subset(slrnew2, slrnew2$state %in% statefinal)
load("../1_Data/slr_cleaned_2022.RData")
slr_census_final<-slr_cleaned
a<-as.data.frame(table(slr_census_final$state,slr_census_final$slr_census_mergestatus))
a1<-subset(a, Var2=="unmatched")
a2<-subset(a, Var2=="fuzzy matched")
a3<-subset(a, Var2=="exact matched")
a1$n1<-a1$Freq #unmatched
a2$n2<-a2$Freq #fuzzy
a3$n3<-a3$Freq #exact
afinal<-cbind(a1,a2,a3)
afinal<-afinal[,c("Var1","n1","n2","n3")]
afinal$total<-round(afinal$n1+afinal$n2+afinal$n3,2)
afinal$matched<-round((afinal$n3+afinal$n2)/(afinal$total)*100,2)
afinal$unmatched<-round((afinal$n1/afinal$total)*100,2)
afinal$fuzzymatched<-round((afinal$n2/afinal$total)*100,2)
afinal$exactmatched<-round((afinal$n3/afinal$total)*100,2)
afinal$sample<-"Excluded"
afinal$sample[afinal$total>=2000 & afinal$exactmatched>=59 & afinal$total>=80]<-"Main Sample"
afinal <- afinal %>%                                        # Create ID by group
group_by(sample) %>%
dplyr::mutate(ID = row_number())
library(dplyr)
load("../1_Data/slr_cleaned_2022.RData")
slr_census_final<-slr_cleaned
a<-as.data.frame(table(slr_census_final$state,slr_census_final$slr_census_mergestatus))
a1<-subset(a, Var2=="unmatched")
a2<-subset(a, Var2=="fuzzy matched")
a3<-subset(a, Var2=="exact matched")
a1$n1<-a1$Freq #unmatched
a2$n2<-a2$Freq #fuzzy
a3$n3<-a3$Freq #exact
afinal<-cbind(a1,a2,a3)
afinal<-afinal[,c("Var1","n1","n2","n3")]
afinal$total<-round(afinal$n1+afinal$n2+afinal$n3,2)
afinal$matched<-round((afinal$n3+afinal$n2)/(afinal$total)*100,2)
afinal$unmatched<-round((afinal$n1/afinal$total)*100,2)
afinal$fuzzymatched<-round((afinal$n2/afinal$total)*100,2)
afinal$exactmatched<-round((afinal$n3/afinal$total)*100,2)
afinal$sample<-"Excluded"
afinal$sample[afinal$total>=2000 & afinal$exactmatched>=59 & afinal$total>=80]<-"Main Sample"
afinal <- afinal %>%                                        # Create ID by group
group_by(sample) %>%
dplyr::mutate(ID = row_number())
afinal<-afinal[,c("ID","Var1","total","unmatched","matched","exactmatched","fuzzymatched","sample")]
afinal$Var1<-as.character(afinal$Var1)
statefinal<-afinal$Var1[afinal$sample=="Main Sample"]
load("../1_Data/slrnew2.RData")
nrow(slrnew2)
# [1] 186988
prop.table(table(slrnew2$proposaltype))
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
prop.table(table(slrnew2$imsupgradeconnect))
# new upgrade
# bridge   5859    2415
# road   126567   52147
slrnew2<-subset(slrnew2, slrnew2$roadcode %in% slr_census_final$roadcode)
# nrow(slrnew2)
# [1] 172204
172204/186988
table(slrnew2$proposaltype)
prop.table(table(slrnew2$proposaltype))
# bridge   road
# 3389 168815
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
# new upgrade
# bridge   2676     713
# road   120476   48339
slrnew2<-subset(slrnew2, slrnew2$state %in% statefinal)
nrow(slrnew2)
# [1] 143725
prop.table(table(slrnew2$proposaltype))
# bridge      road
# 0.0184519 0.9815481
x<-as.data.frame(table(slrnew2$startyear))
library(ggplot2)
# Basic barplot
ggplot(data=x, aes(x=Var1, y=Freq)) +
geom_bar(stat="identity")+
geom_text(aes(label=Freq),vjust=-1.6)+
labs(x="Year", y = "Number of PMGSY projects")+
theme_classic()+  theme(strip.background = element_rect(size=1.5, linetype="blank"))+
theme(strip.text.y = element_text(size=8, angle = 0, hjust = 1))
ggsave("../3_Figs/FigB1.pdf", width=11.5, height=9)
rm(list=ls())
library(rmarkdown)
library(dplyr)
load("../1_Data/slr_cleaned_2022.RData")
slr_census_final<-slr_cleaned
a<-as.data.frame(table(slr_census_final$state,slr_census_final$slr_census_mergestatus))
a1<-subset(a, Var2=="unmatched")
a2<-subset(a, Var2=="fuzzy matched")
a3<-subset(a, Var2=="exact matched")
a1$n1<-a1$Freq #unmatched
a2$n2<-a2$Freq #fuzzy
a3$n3<-a3$Freq #exact
afinal<-cbind(a1,a2,a3)
afinal<-afinal[,c("Var1","n1","n2","n3")]
afinal$total<-round(afinal$n1+afinal$n2+afinal$n3,2)
afinal$matched<-round((afinal$n3+afinal$n2)/(afinal$total)*100,2)
afinal$unmatched<-round((afinal$n1/afinal$total)*100,2)
afinal$fuzzymatched<-round((afinal$n2/afinal$total)*100,2)
afinal$exactmatched<-round((afinal$n3/afinal$total)*100,2)
afinal$sample<-"Excluded"
afinal$sample[afinal$total>=2000 & afinal$exactmatched>=59 & afinal$total>=80]<-"Main Sample"
afinal <- afinal %>%                                        # Create ID by group
group_by(sample) %>%
dplyr::mutate(ID = row_number())
afinal<-afinal[,c("ID","Var1","total","unmatched","matched","exactmatched","fuzzymatched","sample")]
afinal$Var1<-as.character(afinal$Var1)
statefinal<-afinal$Var1[afinal$sample=="Main Sample"]
load("../1_Data/slrnew2.RData")
nrow(slrnew2)
# [1] 186988
prop.table(table(slrnew2$proposaltype))
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
prop.table(table(slrnew2$imsupgradeconnect))
# new upgrade
# bridge   5859    2415
# road   126567   52147
slrnew2<-subset(slrnew2, slrnew2$roadcode %in% slr_census_final$roadcode)
# nrow(slrnew2)
# [1] 172204
172204/186988
table(slrnew2$proposaltype)
prop.table(table(slrnew2$proposaltype))
# bridge   road
# 3389 168815
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
# new upgrade
# bridge   2676     713
# road   120476   48339
slrnew2<-subset(slr_census_final, slr_census_final$state %in% statefinal)
nrow(slrnew2)
# [1] 143725
prop.table(table(slrnew2$proposaltype))
# bridge      road
# 0.0184519 0.9815481
x<-as.data.frame(table(slrnew2$startyear))
library(ggplot2)
# Basic barplot
ggplot(data=x, aes(x=Var1, y=Freq)) +
geom_bar(stat="identity")+
geom_text(aes(label=Freq),vjust=-1.6)+
labs(x="Year", y = "Number of PMGSY projects")+
theme_classic()+  theme(strip.background = element_rect(size=1.5, linetype="blank"))+
theme(strip.text.y = element_text(size=8, angle = 0, hjust = 1))
View(slrnew2)
load("../1_Data/slr_cleaned_2022.RData")
slr_census_final<-slr_cleaned
a<-as.data.frame(table(slr_census_final$state,slr_census_final$slr_census_mergestatus))
a1<-subset(a, Var2=="unmatched")
a2<-subset(a, Var2=="fuzzy matched")
a3<-subset(a, Var2=="exact matched")
a1$n1<-a1$Freq #unmatched
a2$n2<-a2$Freq #fuzzy
a3$n3<-a3$Freq #exact
afinal<-cbind(a1,a2,a3)
afinal<-afinal[,c("Var1","n1","n2","n3")]
afinal$total<-round(afinal$n1+afinal$n2+afinal$n3,2)
afinal$matched<-round((afinal$n3+afinal$n2)/(afinal$total)*100,2)
afinal$unmatched<-round((afinal$n1/afinal$total)*100,2)
afinal$fuzzymatched<-round((afinal$n2/afinal$total)*100,2)
afinal$exactmatched<-round((afinal$n3/afinal$total)*100,2)
afinal$sample<-"Excluded"
afinal$sample[afinal$total>=2000 & afinal$exactmatched>=59 & afinal$total>=80]<-"Main Sample"
afinal <- afinal %>%                                        # Create ID by group
group_by(sample) %>%
dplyr::mutate(ID = row_number())
afinal<-afinal[,c("ID","Var1","total","unmatched","matched","exactmatched","fuzzymatched","sample")]
afinal$Var1<-as.character(afinal$Var1)
statefinal<-afinal$Var1[afinal$sample=="Main Sample"]
load("../1_Data/slrnew2.RData")
nrow(slrnew2)
# [1] 186988
prop.table(table(slrnew2$proposaltype))
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
prop.table(table(slrnew2$imsupgradeconnect))
# new upgrade
# bridge   5859    2415
# road   126567   52147
slrnew2<-subset(slrnew2, slrnew2$roadcode %in% slr_census_final$roadcode)
# nrow(slrnew2)
# [1] 172204
172204/186988
table(slrnew2$proposaltype)
prop.table(table(slrnew2$proposaltype))
# bridge   road
# 3389 168815
table(slrnew2$proposaltype, slrnew2$imsupgradeconnect)
# new upgrade
# bridge   2676     713
# road   120476   48339
slrnew2<-subset(slrnew2, slrnew2$state %in% statefinal)
nrow(slrnew2)
# [1] 143725
prop.table(table(slrnew2$proposaltype))
# bridge      road
# 0.0184519 0.9815481
x<-as.data.frame(table(slrnew2$startyear))
library(ggplot2)
# Basic barplot
ggplot(data=x, aes(x=Var1, y=Freq)) +
geom_bar(stat="identity")+
geom_text(aes(label=Freq),vjust=-1.6)+
labs(x="Year", y = "Number of PMGSY projects")+
theme_classic()+  theme(strip.background = element_rect(size=1.5, linetype="blank"))+
theme(strip.text.y = element_text(size=8, angle = 0, hjust = 1))
ggsave("../3_Figs/FigB1.pdf", width=11.5, height=9)
load("../1_Data/slrnew2.RData")
x<-as.data.frame(table(slrnew2$startyear))
library(ggplot2)
# Basic barplot
ggplot(data=x, aes(x=Var1, y=Freq)) +
geom_bar(stat="identity")+
geom_text(aes(label=Freq),vjust=-1.6)+
labs(x="Year", y = "Number of PMGSY projects")+
theme_classic()+  theme(strip.background = element_rect(size=1.5, linetype="blank"))+
theme(strip.text.y = element_text(size=8, angle = 0, hjust = 1))
ggsave("../3_Figs/FigB1.pdf", width=11.5, height=9)
rm(list=ls())
library(rmarkdown)
rmarkdown::render('02_MatchingTable.rmd', output_file = '../2_Tables/Appendix_Table_B1.pdf')
x<-as.data.frame(table(slrnew2$startyear))
rm(list=ls())
library(rmarkdown)
library(dplyr)
rmarkdown::render('02_MatchingTable.rmd', output_file = '../2_Tables/Appendix_Table_B1.pdf')
load("../1_Data/slrnew2.RData")
x<-as.data.frame(table(slrnew2$startyear))
library(ggplot2)
# Basic barplot
ggplot(data=x, aes(x=Var1, y=Freq)) +
geom_bar(stat="identity")+
geom_text(aes(label=Freq),vjust=-1.6)+
labs(x="Year", y = "Number of PMGSY projects")+
theme_classic()+  theme(strip.background = element_rect(size=1.5, linetype="blank"))+
theme(strip.text.y = element_text(size=8, angle = 0, hjust = 1))
ggsave("../3_Figs/FigB1.pdf", width=11.5, height=9)
